/*
 * =====================================================================================
 *
 *       Filename:  inithard.c
 *
 *    Description:  init hard
 *
 *        Version:  1.0
 *        Created:  2009-12-24 22:49:08
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *        Company:  
 *
 * =====================================================================================
 */


/* 
 * ===  FUNCTION  ======================================================================
 *         Name:  InitGpio
 *  Description:  
 * =====================================================================================
 */

void InitGpio (  )
{
}		/* -----  end of function InitGpio  ----- */
/*-----------------------------------------------------------------------------
 *  
 *-----------------------------------------------------------------------------*/
#include	<Reg51.h>
#include	"Reg51bit.h"
#include	"config.h"
#include	"hardVariable.h"

/*-----------------------------------------------------------------------------
 *  
 *-----------------------------------------------------------------------------*/
void  InitSerial()
{
#ifdef TX_FIFO_ON
	Fifo_Init(&serialTxFifo,serialTxBuf,8);
#endif
#ifdef RX_FIFO_ON
	Fifo_Init(&serialRxFifo,serialRxBuf,8);
#endif
	SCON = SM_MODE0	;
	IE |= BIT_INI_ENSER;
}

/*-----------------------------------------------------------------------------
 *  
 *-----------------------------------------------------------------------------*/
void InitTimer0()
{
	TH0 = (0xffff-DELAYTIME)>>8;
	TL0 = (0xffff-DELAYTIME)&&0xff;
	SETT0MOD(TMOD_MODE1);  //????
       	TCON =  BIT_TR0 ;
	IE |= BIT_INI_ENT0;
}


/*-----------------------------------------------------------------------------
 *允许中断 
 *-----------------------------------------------------------------------------*/
void EnInterrupt (  )
{
	IE |= BIT_INT_ENALL;
}		/* -----  end of function EnInterrupt  ----- */
